1. The Field of the Invention
The present invention generally relates to optical media recording systems. More particularly, the present invention provides systems, methods and computer program products for improving high speed optical media recording rates by dynamically calculating a time delay in transferring data from a computer system to an optical media drive in order to prevent buffer underrun.
2. Background and Relevant Art
Optical media recorders have opened a new world of information sharing. In contrast to similarly sized magnetic media, optical media allows for the storage of significantly more data in the same space. Optical discs can be used to store any type of digital information, including images, audio, application programs and data, web pages, video, etc. Although initially quite expensive and complex, optical media recorders and discs have become increasingly affordable and easier to use. It is now possible for a typical user to record optical discs that can be read by most any compact disc (CD) player, Digital Video Disc (DVD) player, or other optical drive/player.
In spite of technological improvements with optical media recorders, some performance problems remain. For example, one of the most common performance problems in recording to an optical disc is known as buffer-underrun. When recording to optical media it is important that the flow of data streaming to the optical media recorder be relatively constant. Optical media recorders generally have an internal memory buffer to compensate for small gaps or delays in transferring data; however, if the data flow is interrupted for too long, the optical media recorder will run out of data. As described in more detail below, at best buffer underruns lead to poor performance. For example, depending on the type of data being recorded and the sophistication of the optical media recorder, a buffer underrun may cause gaps or noise in the recording and lead to slow recording speeds. In many cases, however, a buffer underrun ruins the disc being written.
One optical media recorder technique to account for buffer underruns (without ruining the disc being written) includes the optical media recorder constantly checking or monitoring the status of the optical media recorder's internal buffer. When an impending buffer-underrun condition is detected (e.g., the buffer falls below a certain threshold of its maximum capacity) recording is stopped in a controlled fashion at a specific location. Then, when the buffer has been sufficiently replenished, recording resumes at the specific location. However, stopping the drive, waiting for the buffer to fill, spinning the drive back up, resynching, and restarting the write delays the recording process, particularly if it occurs multiple times in recording a single disc. Furthermore, this technique leads to a small gap in the recorded data. While this gap is small enough for most drives to be able to automatically recover from, some drives (especially consumer audio CD players) are unable to smoothly handle this gap, resulting in undesirable “pops” or “clicks” in the final audio heard or corrupted data.
Some delays in transferring data to an optical media recorder are normal and to be expected. For example, when the optical media recorder's internal buffer is full, there is no need to send or attempt to send additional data to the optical media recorder. In many computer systems, resources can be put to other productive uses for some period of time. Traditionally, this time period has been hard coded, typically ranging from about 100 to 250 ms, and has not accounted for a variety of factors, such as recording speed, buffer size, the size of an individual write, etc. For a time, the hardcoded delay was not much of a problem because most recorders had similar performance characteristics.
With recent advances in optical media recording technology, however, optical media recorders vary substantially in performance, most notably in recording speed. In spite of these technology advances, the hardcoded delay remains. As optical media recording performance continues to improve, the effects of a hardcoded delay are likely to be more noticeable, with buffer underruns becoming more common and therefore limiting the quality and speed of optical recordings with greater frequency.
As indicated above, traditional hardcoded delays simply fail to account for individual characteristics of a given optical media recorder, such as recording speed, buffer size, the size of an individual write, and so on. Accordingly, as these factors vary, from one device to another, or perhaps even within the same device (e.g., recording speed often vary based on the optical media being used), there has been no corresponding change in the delay time period. For example, as optical media recorders increase in writing speed, the entire internal buffer may be emptied within the fixed time delay period, causing a buffer underrun. As a result, the full performance potential, both in terms of quality and speed, of the optical media recorder is undermined and cannot be achieved.
An alternative technique to the fixed or hardcoded time delay period uses a percentage full calculation and a user-specified threshold for the internal buffer. The percentage full calculation and threshold are used to refill the internal buffer when a selected percentage of the buffer's total capacity has been emptied. This solution, however, also has several significant shortcomings. First, there is a significant performance cost associated with the overhead of continuously checking the buffer to determine when the buffer has been depleted below a certain percentage. To account for this overhead, the priority of the process checking and writing to the buffer may need to be adjusted to receive more processing time, which reduces the processing resources that are available to other tasks. Furthermore, it should be noted that the relationship between a buffer, a percentage of the buffer's capacity, process priority, and the processing load from other concurrently running tasks is fairly sophisticated and is likely beyond the expertise of most users.
The percentage full technique also fails to account for the differing record rates for different media. For example, typically the record rate for a CD-R disc is greater than the record rate for a CD-RW disc. As a result, a depletion percentage that may be optimal for CD-RW media may be inadequate for CD-R media, and a percentage that may be optimal for CD-R media may be wasteful for CD-RW media.
Accordingly, there exists a need for improving high speed optical media recording rates by dynamically calculating a time delay in transferring data to an optical media recorder in order to prevent underruning the optical media recorder's internal buffer.